<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Health-AI 医护后台系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
            background-color: #f0f2f5;
            color: #333;
        }
        
        .container {
            display: flex;
            min-height: 100vh;
        }
        
        /* 侧边栏 */
        .sidebar {
            width: 240px;
            background: #001529;
            color: white;
            transition: all 0.3s;
            overflow-y: auto;
        }
        
        .logo {
            height: 32px;
            margin: 16px;
            background: rgba(255, 255, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
            font-weight: bold;
        }
        
        .menu {
            list-style: none;
            padding: 0;
        }
        
        .menu-item {
            padding: 0 16px;
            cursor: pointer;
            height: 40px;
            display: flex;
            align-items: center;
        }
        
        .menu-item:hover {
            background: #1890ff;
        }
        
        .menu-item.active {
            background: #1890ff;
        }
        
        /* 主体内容 */
        .main {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        /* 顶部导航 */
        .header {
            background: #fff;
            padding: 0 24px;
            height: 64px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
        }
        
        .search-box {
            flex: 1;
            max-width: 400px;
            margin: 0 20px;
        }
        
        .search-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            cursor: pointer;
        }
        
        .avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #1890ff;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            margin-left: 8px;
        }
        
        /* 内容区域 */
        .content {
            flex: 1;
            padding: 24px;
            overflow-y: auto;
        }
        
        .breadcrumb {
            margin-bottom: 16px;
            color: #666;
        }
        
        .page-title {
            margin-bottom: 24px;
            font-size: 24px;
            font-weight: bold;
        }
        
        /* 卡片 */
        .card {
            background: #fff;
            border-radius: 4px;
            padding: 24px;
            margin-bottom: 24px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        .card-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        /* KPI卡片 */
        .kpi-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 24px;
            margin-bottom: 24px;
        }
        
        .kpi-card {
            background: #fff;
            border-radius: 4px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        .kpi-label {
            font-size: 14px;
            color: #666;
            margin-bottom: 8px;
        }
        
        .kpi-value {
            font-size: 24px;
            font-weight: bold;
        }
        
        .kpi-primary { color: #1890ff; }
        .kpi-success { color: #52c41a; }
        .kpi-warning { color: #faad14; }
        .kpi-danger { color: #f5222d; }
        
        /* 表格 */
        .table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .table th,
        .table td {
            padding: 12px 16px;
            text-align: left;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .table th {
            background: #fafafa;
            font-weight: 500;
        }
        
        .table tr:hover {
            background: #fafafa;
        }
        
        /* 按钮 */
        .btn {
            display: inline-block;
            padding: 6px 12px;
            border: 1px solid #d9d9d9;
            border-radius: 4px;
            background: #fff;
            cursor: pointer;
            font-size: 14px;
            margin-right: 8px;
            margin-bottom: 8px;
        }
        
        .btn:hover {
            background: #f5f5f5;
        }
        
        .btn-primary {
            background: #1890ff;
            border-color: #1890ff;
            color: white;
        }
        
        .btn-primary:hover {
            background: #40a9ff;
            border-color: #40a9ff;
        }
        
        .btn-danger {
            color: #f5222d;
        }
        
        .btn-danger:hover {
            background: #fff2f0;
            border-color: #ffccc7;
        }
        
        /* 标签 */
        .tag {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 12px;
            margin-right: 4px;
            background: #f0f2f5;
        }
        
        .tag-success {
            background: #f6ffed;
            color: #52c41a;
            border: 1px solid #b7eb8f;
        }
        
        .tag-warning {
            background: #fffbe6;
            color: #faad14;
            border: 1px solid #ffe58f;
        }
        
        .tag-danger {
            background: #fff2f0;
            color: #f5222d;
            border: 1px solid #ffccc7;
        }
        
        /* 图表容器 */
        .chart-container {
            height: 300px;
            width: 100%;
            background: #fafafa;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 20px 0;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                height: auto;
            }
            
            .menu {
                display: flex;
                overflow-x: auto;
            }
            
            .menu-item {
                white-space: nowrap;
            }
            
            .kpi-cards {
                grid-template-columns: 1fr;
            }
        }
        
        /* 页脚 */
        .footer {
            text-align: center;
            padding: 16px;
            color: #666;
            font-size: 12px;
            border-top: 1px solid #f0f0f0;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="logo">Health-AI</div>
            <ul class="menu">
                <li class="menu-item active" data-page="dashboard">
                    <span>仪表盘</span>
                </li>
                <li class="menu-item" data-page="patients">
                    <span>患者管理</span>
                </li>
                <li class="menu-item" data-page="glucose">
                    <span>血糖监测</span>
                </li>
                <li class="menu-item" data-page="diet">
                    <span>饮食记录</span>
                </li>
                <li class="menu-item" data-page="devices">
                    <span>设备管理</span>
                </li>
                <li class="menu-item" data-page="reports">
                    <span>报告中心</span>
                </li>
                <li class="menu-item" data-page="settings">
                    <span>系统设置</span>
                </li>
            </ul>
        </div>
        
        <!-- 主体内容 -->
        <div class="main">
            <!-- 顶部导航 -->
            <div class="header">
                <div class="search-box">
                    <input type="text" class="search-input" placeholder="全局搜索（患者/报告/设备）">
                </div>
                <div class="user-info">
                    <span>管理员</span>
                    <div class="avatar">管</div>
                </div>
            </div>
            
            <!-- 内容区域 -->
            <div class="content">
                <div class="breadcrumb">
                    <span>首页</span> / <span id="current-page-name">仪表盘</span>
                </div>
                
                <!-- 仪表盘页面 -->
                <div id="dashboard-page" class="page">
                    <h2 class="page-title">仪表盘</h2>
                    
                    <!-- KPI卡片 -->
                    <div class="kpi-cards">
                        <div class="kpi-card">
                            <div class="kpi-label">总患者数</div>
                            <div class="kpi-value kpi-primary">128</div>
                        </div>
                        <div class="kpi-card">
                            <div class="kpi-label">今日血糖异常</div>
                            <div class="kpi-value kpi-danger">8</div>
                        </div>
                        <div class="kpi-card">
                            <div class="kpi-label">在线设备</div>
                            <div class="kpi-value kpi-success">42</div>
                        </div>
                        <div class="kpi-card">
                            <div class="kpi-label">待处理告警</div>
                            <div class="kpi-value kpi-warning">3</div>
                        </div>
                    </div>
                    
                    <!-- 图表和列表 -->
                    <div class="card">
                        <div class="card-title">血糖趋势</div>
                        <div class="chart-container">
                            <div>血糖趋势图表 (模拟显示)</div>
                        </div>
                    </div>
                    
                    <div class="card">
                        <div class="card-title">设备在线状态</div>
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>设备名称</th>
                                    <th>状态</th>
                                    <th>IP地址</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>血糖仪-001</td>
                                    <td><span class="tag tag-success">在线</span></td>
                                    <td>192.168.1.101</td>
                                </tr>
                                <tr>
                                    <td>血压计-002</td>
                                    <td><span class="tag tag-success">在线</span></td>
                                    <td>192.168.1.102</td>
                                </tr>
                                <tr>
                                    <td>体重秤-003</td>
                                    <td><span class="tag tag-danger">离线</span></td>
                                    <td>192.168.1.103</td>
                                </tr>
                                <tr>
                                    <td>心电图-004</td>
                                    <td><span class="tag tag-success">在线</span></td>
                                    <td>192.168.1.104</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    
                    <div class="card">
                        <div class="card-title">最近告警</div>
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>患者</th>
                                    <th>时间</th>
                                    <th>内容</th>
                                    <th>类型</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>张三</td>
                                    <td>2025-10-31 08:30</td>
                                    <td>8.5 mmol/L</td>
                                    <td><span class="tag tag-danger">高血糖</span></td>
                                </tr>
                                <tr>
                                    <td>李四</td>
                                    <td>2025-10-31 07:45</td>
                                    <td>3.2 mmol/L</td>
                                    <td><span class="tag tag-warning">低血糖</span></td>
                                </tr>
                                <tr>
                                    <td>王五</td>
                                    <td>2025-10-31 06:20</td>
                                    <td>设备离线</td>
                                    <td><span class="tag tag-danger">设备告警</span></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                
                <!-- 患者管理页面 -->
                <div id="patients-page" class="page" style="display: none;">
                    <h2 class="page-title">患者管理</h2>
                    
                    <div class="card">
                        <div style="display: flex; justify-content: space-between; margin-bottom: 16px;">
                            <input type="text" class="search-input" placeholder="搜索患者" style="width: 200px;">
                            <button class="btn btn-primary">新增患者</button>
                        </div>
                        
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>姓名</th>
                                    <th>年龄</th>
                                    <th>性别</th>
                                    <th>标签</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>张三</td>
                                    <td>65</td>
                                    <td>男</td>
                                    <td>
                                        <span class="tag tag-danger">糖尿病</span>
                                        <span class="tag tag-danger">高危</span>
                                    </td>
                                    <td>
                                        <button class="btn">编辑</button>
                                        <button class="btn btn-danger">删除</button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>李四</td>
                                    <td>58</td>
                                    <td>女</td>
                                    <td>
                                        <span class="tag tag-warning">高血压</span>
                                    </td>
                                    <td>
                                        <button class="btn">编辑</button>
                                        <button class="btn btn-danger">删除</button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>王五</td>
                                    <td>72</td>
                                    <td>男</td>
                                    <td>
                                        <span class="tag tag-danger">糖尿病</span>
                                        <span class="tag tag-danger">心脏病</span>
                                    </td>
                                    <td>
                                        <button class="btn">编辑</button>
                                        <button class="btn btn-danger">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                
                <!-- 其他页面可以类似实现 -->
                <div id="glucose-page" class="page" style="display: none;">
                    <h2 class="page-title">血糖监测</h2>
                    <div class="card">
                        <div class="card-title">血糖记录</div>
                        <p>血糖监测功能演示</p>
                    </div>
                </div>
                
                <div id="diet-page" class="page" style="display: none;">
                    <h2 class="page-title">饮食记录</h2>
                    <div class="card">
                        <div class="card-title">饮食记录</div>
                        <p>饮食记录功能演示</p>
                    </div>
                </div>
                
                <div id="devices-page" class="page" style="display: none;">
                    <h2 class="page-title">设备管理</h2>
                    <div class="card">
                        <div class="card-title">设备列表</div>
                        <p>设备管理功能演示</p>
                    </div>
                </div>
                
                <div id="reports-page" class="page" style="display: none;">
                    <h2 class="page-title">报告中心</h2>
                    <div class="card">
                        <div class="card-title">报告列表</div>
                        <p>报告中心功能演示</p>
                    </div>
                </div>
                
                <div id="settings-page" class="page" style="display: none;">
                    <h2 class="page-title">系统设置</h2>
                    <div class="card">
                        <div class="card-title">系统配置</div>
                        <p>系统设置功能演示</p>
                    </div>
                </div>
            </div>
            
            <!-- 页脚 -->
            <div class="footer">
                ©2025 Health-AI 医护后台系统 | 版本 1.0.0
            </div>
        </div>
    </div>

    <script>
        // 页面切换功能
        document.addEventListener('DOMContentLoaded', function() {
            const menuItems = document.querySelectorAll('.menu-item');
            const pages = document.querySelectorAll('.page');
            const currentPageName = document.getElementById('current-page-name');
            
            // 页面名称映射
            const pageNames = {
                'dashboard': '仪表盘',
                'patients': '患者管理',
                'glucose': '血糖监测',
                'diet': '饮食记录',
                'devices': '设备管理',
                'reports': '报告中心',
                'settings': '系统设置'
            };
            
            menuItems.forEach(item => {
                item.addEventListener('click', function() {
                    const page = this.getAttribute('data-page');
                    
                    // 更新菜单激活状态
                    menuItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 切换页面显示
                    pages.forEach(p => {
                        p.style.display = 'none';
                    });
                    document.getElementById(`${page}-page`).style.display = 'block';
                    
                    // 更新面包屑
                    currentPageName.textContent = pageNames[page];
                });
            });
        });
    </script>
</body>
</html>
